package com.study.config;

import com.study.servletComponent.MyFilter;
import com.study.servletComponent.MyListener;
import com.study.servletComponent.MyServlet;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.boot.web.servlet.ServletListenerRegistrationBean;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.Arrays;

//@Configuration
//public class ServletConfig {
//
//    @Bean
//    public ServletRegistrationBean getServlet(MyServlet myServlet){
//        ServletRegistrationBean<MyServlet> registrationBean =
//                new ServletRegistrationBean<>(myServlet, "/myServlet");
//        return registrationBean;
//    }
//
//
//
//@Bean
//    public FilterRegistrationBean getFilter(MyFilter myFilter){
//
//        FilterRegistrationBean<MyFilter> registrationBean =
//                new FilterRegistrationBean<>(myFilter);
//        registrationBean.setUrlPatterns(Arrays.asList("/toLoginPage","/myFilter"));
//        return registrationBean;
//    }
//    @Bean
//    public ServletListenerRegistrationBean getServletListener(MyListener myListener){
//
//        ServletListenerRegistrationBean registrationBean =
//                new ServletListenerRegistrationBean(myListener);
//        return registrationBean;
//    }

//}
